import request from "@/request";

export async function userLoginUsingPost(body) {
    return request({
        method: "POST",
        url: "/api/user/login",
        data: body
    });
}

export async function getLoginUserUsingGet() {
    return request({
        method: "GET",
        url: "/api/user/get/login"
    });
}

export async function userLogoutUsingPost(){
    return request({
        method: "POST",
        url: "/api/user/logout"
    })
}

export async function userRegisterUsingPost(body) {
    return request({
        method: "POST",
        url: "/api/user/register",
        data: body
    })
}

export async function getUserVOByIdUsingGet(userId) {
    return request({
        method: "GET",
        url: "/api/user/get/vo",
        params:{
            id: userId
        }
    })
}

export async function listUserByPageUsingPost(body) {
    return request({
        method: "POST",
        url: "/api/user/list/page",
        data: body
    })
}

export async function deleteUserUsingPost(body) {
    return request({
        method: "POST",
        url: "/api/user/delete",
        data: body
    })
}

export async function updateUserUsingPost(body) {
    return request({
        method: "POST",
        url: "/api/user/update",
        data: body
    })
}

export async function getUserByIdUsingGet(userId) {
    return request({
        method: "GET",
        url: "/api/user/get",
        params:{
            id: userId
        }
    })
}

export async function updateMyUserUsingPost(body) {
    return request({
        method: "POST",
        url: "/api/user/update/my",
        data: body
    })
}